/**
 * 构造函数继承
 *  原型链上的方法不能继承
 */

function Father (name) {
  this.name = name
  this.types = ['武侠','言情','玄幻']
}

Father.prototype.sayName = function () {
  console.log(this.name)
}

function Son (name,age){
  Father.call(this,name)
  this.age = age
}

Son.prototype.sayAge = function (){
  console.log(this.age)
}

let mySon = new Son('lujb',20)
let mySon2 = new Son('qqqq',30)
mySon.sayName()
mySon.types.push('漫画')
console.log(mySon.types)
console.log(mySon2.types)